<template>
  <div class="container">
    <div class="operate">
      <slot></slot>
      <div style="margin-right: auto"></div>
      <slot name="op"></slot>
    </div>
    <!-- 头部标题 -->
    <div class="header">
      <div class="header-main">
        <div class="img">
          <el-avatar :size="64" :src="item?.data?.icon" />
        </div>
        <div>
          <div class="header-title">
            <div style="margin-right: 5px">
              {{ item?.data?.name?.["zh_CN"] }}
            </div>
            <div style="color: #ccc">进行中</div>
          </div>
          <div class="header-sub">
            <el-avatar :size="24" :src="item?.data?.creatorObject?.avatar" />
            <div style="margin: 0px 5px">{{ item?.data?.creatorName }}</div>
            <div>{{ item?.data?.createTime }}</div>
          </div>
        </div>
      </div>
    </div>
    <!-- 内容部分 -->
    <div class="content" :style="{ maxHeight: item.h * 40 - 130 + 'px' }">
      <div class="content-item">
        <div class="content-item-desc">描述</div>
        <div class="">{{ item?.data?.remark }}</div>
      </div>

      <div class="content-item">
        <div class="content-item-desc">项目进度</div>
        <div style="width: 100%">
          <el-progress :percentage="item?.data?.progress ?? 0" />
        </div>
      </div>

      <div class="content-item">
        <div class="content-item-desc">计划开始时间</div>
        <div style="font-weight: 700">{{ item.data?.plannedStartTime }}</div>
      </div>

      <div class="content-item">
        <div class="content-item-desc">实际开始时间</div>
        <div style="font-weight: 700">{{ item.data?.actualStartTime }}</div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
  /**
   * @description 业务组件 -- 基本信息
   */
  import { defineProps } from "vue";
  defineProps(["item"]);
</script>

<style scoped lang="scss">
  .container {
    user-select: none;
    box-sizing: border-box;
    height: 100%;
    padding: 0px 10px 10px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    .header {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      font-weight: 500;
      font-size: 16px;
      color: #141414;
      .img {
        margin-right: 5px;
        width: 64px;
        height: 64px;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .header-main {
        display: flex;
        align-items: center;
        flex-direction: row;
        justify-content: flex-start;
        width: 100%;
        font-size: 14px;
      }
      .header-title {
        display: flex;
        justify-content: flex-start;
        flex-direction: row;
        align-items: center;
      }
      .header-sub {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        color: #999;
        font-size: 12px;
      }
    }
    .content {
      display: flex;
      flex-direction: column;
      margin: 10px 0 0 64px;
      flex: 1;
      overflow: auto;
      .content-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        margin-bottom: 5px;
        .content-item-desc {
          width: 100px;
          min-width: 100px;
          overflow: hidden;
        }
      }
    }
    .operate {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: flex-end;
    }
  }
  .operate {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }
</style>
